Links
Tags
NodeJS for Raspberry Pi Zero and Tetris Clock
Working on some Raspberry Pi Zero projects this-afternoon, and note that there's no simple script for installing NodeJS onto armv6 hardware. Really just making a mental note here to run this to get the latest (last) compatible version of NodeJS running on Raspbian Lite.
sudo apt update
sudo apt install -y git
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
sudo init 6
nvm install 10
nvm install-latest-npm
npm install -g node-gyp
Suffice to say, some years back I saw a few videos of people making Tetris style clocks that did not use a random algorithm to pick pieces and rotate them into place. Perhaps a post for another day, but fiddling about with this project on a Raspberry Pi 4, a rPI-P10 controller and a P5 Panel, I'm well on my way to condensing this into a Pi Zero form factor.
Knobs, Wiring and Buttons - Progressing on the A320 FCU
I haven't had a lot of time the last few weeks to work on the FCU much further, however there are a couple of updates worth sharing.
Minor redesign to the back plate
I had this grand idea to make insertable Korry's into place and have them as removable independent units. Unfortunately, those LED lights wouldn't fit inside the chamber I had printed and the outcome wasn't great. To get around the need to glue and design all of those components, I had completed another design - this time where the chamber was integrated to the backplate. As I wasn't too sure about the tolerances here, I had printed a few different sizes to work with the Korry inserts but I really only had one shot at getting the backplate done.
With this out of the way, the next step was to insert buttons and led lights into each of these new chambers. Again, this took several goes that I had pre-empted and thus the creation of different sizes - but thankfully things like leaving a large gap to slip the buttons in really helped out here. It was fiddly though, and you really get to know just how tight (i.e. < 0.1mm inaccuracies) things may fit or require a bit of filing and cutting to get things in snug.
With the screens in place, it's starting to come along.
Installing the Rotary Encoders
I've spent a bit of time going back and forth on getting a good, repeatable push-pull rotary encoder working and in the middle of doing this had learned a few more quirks about the printer - especially printing such small volume items. For the Rotary Encoders in particular, when I began I was printing shells, stalks and knobs altogether with the same material. As I started printing smaller volumes, I started getting stringy mess and prints that wouldn't be loose enough around the rotary encoder itself.
Having not had to level this printer for a few months, I figured at the very least I'd clean up the bed, re-level it manually and give the internals a good clean too (ensure the filament isn't slipping in the extruder from a build-up of gunk). I'd 3D Print a calibration cube and everything was within known tolerances (< 0.1mm on the Z axis but otherwise everything else recorded a perfect 2mm). I had printed a few other things at the same time and they also come out well without stringing. It finally dawned on me that perhaps the part was 'too hot' and wasn't given enough time to 'cool down' before applying the next layer. So to remedy the next print, instead of printing one stalk - I printed all the working parts and things kind of went back to normal.
The reality is that when you start playing with your printer - you start having to 'learn' all the quirks again. Having a more level bed and now knowing about volume of prints to help dissipate heat means you're back to calibrating your software settings to compensate too. So it's fair to say that it took quite a few goes before usable prints were coming out.
With the first prototype in place things are looking on the up. This particular switch has the right clearance off the button at the back and works perfectly. I perhaps had unrealistic expectations that the same will occur for the other ones - but unfortunately it didn't quite work that way. For the second rotary encoder, the disc didn't quite go all the way down on the rotary encoder so the disc itself in the 'release' mode was touching right up against the pull mechanism - not a great outcome. It's fair to say that in hindsight, I would probably use a longer stalk button to remove that margin of error and perhaps had a bit more of a gap and maybe a spring to help. In any case, something to improve on.
Things get a bit more challenging for the altitude selector. There's an outer ring that selects either increments of 100 or 1,000 - this would need to sit around the stalk and be some kind of a compression fit to hold the selection. I don't expect this mechanism to last long - and perhaps a second encoder or toggle switch might have helped (there are plenty of options on Thingiverse). Behind the scenes would be a microswitch that by using very little friction at all, can sit on the microswitch when activated.
With the selector and activator connected together, and the microswitch installed - we should be able to select 100 or 1,000 with some creative license by rotating the ring. The final piece of the puzzle was working out how far the grip should protrude. Apart from having to print this a few times, this was perhaps the easiest part to assemble and now the knob and selector fit reasonably well.
What's next?
I'm at the final stages now of the assembly itself leaving behind some fiddly and trivial components.
- An Arduino Mega 2560 needs to be wired up. I've got some proto boards ready to solder all the wires to.
- A shell for the components to sit in. This is currently printing whilst typing.
- Printing some Korry labels - this will likely be a transparency on a white sheet of paper.
- Get this all running and working in Flight Simulator, via SimConnect.
- Final decorations - black shroud for the LCD screens for example.
It's fair to say that should this be a repeatable design, I think I would embrace sacrificing imitation for simplicity. For example, the Korry 'pull' action might very well be replaced with additional push buttons on the face. That would then leave the rotary encoders available for a very simple installation. The same applies for the 100/1,000 selector - that might well be a toggle button or a switch. The Korry switches themselves could be made significantly smaller with a larger button - possibly a Cherry MX style key switch. The 1602 LED screens might well stay, although a future version I want to wire up using custom 7-segment displays and LED status lights. None-the-less, it's been a great learning project and hopefully we're only one or two posts away from testing a flight from Melbourne to Sydney.